package test.format_test;

/**
 * @author ：蔡博
 * @description：TODO
 * @date ：2022/4/5 21:31
 */
public class inner {
    public static void main(String[] args) {
        outer a = new outer();
        a.toin();
        eat b = a.geteat();
        b.eating();
        System.out.println(b.getClass());
        animal a1 = new animal();
        animal a2 = new animal();
        a1.a = a2;
        a2.a = a1;
        System.out.println(a1.a.a.a.a.a.a.a.a.a.a.a);
        outer.inner2 g = a.new inner2();
    }
}


class outer{
    //protected inner c = new inner();
    private int a=10;

    class inner2{
        int a1 = 10;
    }
    public eat e = new eat(){
        public void eating(){
            System.out.println("匿名后喝了奶茶");
        }
    };
    public void toin(){
        class inner1{
            private int b =10;
        }
        inner1 in = new inner1();
        System.out.println(in.b);
    }
    public eat geteat(){
        return e;
    }
}

class dog extends animal implements eat{
public void eating(){
    System.out.println("吃了点奥利奥");
}
}

class animal{
animal a;
}

interface eat{
public void eating();
}